package Backend;

import org.snmp4j.agent.mo.MOAccessImpl;
import org.snmp4j.agent.mo.MOScalar;
import org.snmp4j.smi.Integer32;
import org.snmp4j.smi.OID;
import org.snmp4j.smi.OctetString;

public class MoCreation {

    public static MOScalar createReadOnly(OID oid, String value) {
        return new MOScalar(oid,
                MOAccessImpl.ACCESS_READ_ONLY, new OctetString(value));
    }
   
    public static MOScalar createReadOnly(OID oid, boolean value) {
        return new MOScalar(oid,
                MOAccessImpl.ACCESS_READ_ONLY, new Integer32((value)?1:0));
    }
    
    public static MOScalar createReadOnly(OID oid, int value) {
        return new MOScalar(oid,
                MOAccessImpl.ACCESS_READ_ONLY, new Integer32(value));
    }

    public static MOScalar createReadWrite(OID oid, String value) {
        return new MOScalar(oid,
                MOAccessImpl.ACCESS_READ_WRITE, new OctetString(value));
    } 
    
    public static MOScalar createReadWrite(OID oid, boolean value) {
        return new MOScalar(oid,
                MOAccessImpl.ACCESS_READ_WRITE, new Integer32((value)?1:0));
    }
}
